package com.yun.zf.common.esIndex;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;

/**
 * 客源es 索引
 */
@Data
@Document(indexName = "customer_index", shards = 1, replicas = 0)
public class CustomerIndexTemplate {
    @Id
    private String customerId;

    @Field(type = FieldType.Long)
    private Long provinceCode;
    @Field(type = FieldType.Long)
    private Long cityCode;
    @Field(type = FieldType.Keyword)
    private String phone;
    @Field(type = FieldType.Keyword)
    private String status;
    @Field(type = FieldType.Nested)
    public List<CustomerRequirementTemplate> requirements;

    @Field(type = FieldType.Keyword)
    private String space;

    @Field(type = FieldType.Integer)
    private int agentNo;
    @Field(type = FieldType.Keyword)
    private String name;
}
